/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package controller.database;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Shengyi_Chen
 */
@Entity
@Table(name = "POD")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pod.findAll", query = "SELECT p FROM Pod p"),
    @NamedQuery(name = "Pod.findByPodid", query = "SELECT p FROM Pod p WHERE p.podid = :podid"),
    @NamedQuery(name = "Pod.findByCpu", query = "SELECT p FROM Pod p WHERE p.cpu = :cpu"),
    @NamedQuery(name = "Pod.findByCorenum", query = "SELECT p FROM Pod p WHERE p.corenum = :corenum"),
    @NamedQuery(name = "Pod.findByMemory", query = "SELECT p FROM Pod p WHERE p.memory = :memory"),
    @NamedQuery(name = "Pod.findByHd", query = "SELECT p FROM Pod p WHERE p.hd = :hd"),
    @NamedQuery(name = "Pod.findByCapacity", query = "SELECT p FROM Pod p WHERE p.capacity = :capacity"),
    @NamedQuery(name = "Pod.findByCapOccupied", query = "SELECT p FROM Pod p WHERE p.capOccupied = :capOccupied"),
    @NamedQuery(name = "Pod.findByCapLeft", query = "SELECT p FROM Pod p WHERE p.capLeft = :capLeft"),
    @NamedQuery(name = "Pod.findByLocation", query = "SELECT p FROM Pod p WHERE p.location = :location")})
public class Pod implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 5)
    @Column(name = "PODID")
    private String podid;
    @Size(max = 16)
    @Column(name = "CPU")
    private String cpu;
    @Column(name = "CORENUM")
    private Integer corenum;
    @Column(name = "MEMORY")
    private Integer memory;
    @Column(name = "HD")
    private Integer hd;
    @Column(name = "CAPACITY")
    private Integer capacity;
    @Column(name = "CAP_OCCUPIED")
    private Integer capOccupied;
    @Column(name = "CAP_LEFT")
    private Integer capLeft;
    @Size(max = 5)
    @Column(name = "LOCATION")
    private String location;

    public Pod() {
    }

    public Pod(String podid) {
        this.podid = podid;
    }

    public String getPodid() {
        return podid;
    }

    public void setPodid(String podid) {
        this.podid = podid;
    }

    public String getCpu() {
        return cpu;
    }

    public void setCpu(String cpu) {
        this.cpu = cpu;
    }

    public Integer getCorenum() {
        return corenum;
    }

    public void setCorenum(Integer corenum) {
        this.corenum = corenum;
    }

    public Integer getMemory() {
        return memory;
    }

    public void setMemory(Integer memory) {
        this.memory = memory;
    }

    public Integer getHd() {
        return hd;
    }

    public void setHd(Integer hd) {
        this.hd = hd;
    }

    public Integer getCapacity() {
        return capacity;
    }

    public void setCapacity(Integer capacity) {
        this.capacity = capacity;
    }

    public Integer getCapOccupied() {
        return capOccupied;
    }

    public void setCapOccupied(Integer capOccupied) {
        this.capOccupied = capOccupied;
    }

    public Integer getCapLeft() {
        return capLeft;
    }

    public void setCapLeft(Integer capLeft) {
        this.capLeft = capLeft;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (podid != null ? podid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pod)) {
            return false;
        }
        Pod other = (Pod) object;
        if ((this.podid == null && other.podid != null) || (this.podid != null && !this.podid.equals(other.podid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "controller.database.Pod[ podid=" + podid + " ]";
    }
    
}
